Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3888 typed context and parser #3950

Merged
merged 18 commits into from
Jun 20, 2024
Merged

Conversation

jberthold
Copy link
Member

  • Introduces a JSON-enabled type for the log context
  • Uses the new type in all booster logging
  • Modifies count-aborts to parse the json data using the new type. Performance is on par after switching to TH-derived FromJSON instances.

Conversion of kore-rpc logging is left for future work.
Part of #3888


withPatternContext :: LoggerMIO m => Pattern -> m a -> m a
withPatternContext Pattern{term, constraints} m =
let t' = foldl' AndTerm term $ Set.toList $ Set.map coerce constraints
let t' = foldl' AndTerm term $ Set.toList $ Set.map coerce constraints -- FIXME
Copy link
Member Author

@jberthold jberthold Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this earlier while trying to copy/paste a KoreJson pattern from a log into a file for custom requests.

  • The output does not have the correct sort (we would need to introduce #Equals{SortBool, <sort-of-term>}(true, _) around the predicates)
  • That would mean we cannot use AndTerm any more
    We should probably go to KoreJson first (externalise the pattern) for the output, but then we need to come up with a stable hash for logging purposes

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it cause issues when internalising? I.e. when you copy/pasted KoreJson from a log line and tried to send that to the server it reported an error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server rejects the predicates having a wrong sort IIRC, but I would have to re-try this to be sure.

@jberthold jberthold force-pushed the 3888-typed-context-and-parser branch from ec5ccf3 to bcef5c3 Compare June 20, 2024 05:34
@jberthold jberthold marked this pull request as ready for review June 20, 2024 06:43
Copy link
Collaborator

@geo2a geo2a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Monumental work and a major improvement!

booster/library/Booster/SMT/Interface.hs Outdated Show resolved Hide resolved
@@ -230,7 +230,7 @@ main = do
kore@KoreServer{runSMT} <-
mkKoreServer Log.LoggerEnv{logAction} clOPts koreSolverOptions
runBoosterLogger $
Booster.Log.withContext "proxy" $
Booster.Log.withContext CtxKore $
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rv-jenkins rv-jenkins merged commit fb59a84 into master Jun 20, 2024
6 checks passed
@rv-jenkins rv-jenkins deleted the 3888-typed-context-and-parser branch June 20, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants